<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Freetype OpenGL: text-buffer.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="style.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="content"><!-- do not remove this div! -->

<div id="top"><!-- do not remove this div! -->

  
  <div id="titlearea">
    
    <div id="projectname">Freetype OpenGL</div>
    
    
    <div id="projectbrief">A high quality OpenGL text rendering engine for C</div>
    
  </div>
  

<!--

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Freetype OpenGL
   &#160;<span id="projectnumber">0.1</span>
   </div>
   <div id="projectbrief">A high quality OpenGL text rendering engine for C</div>
  </td>
  
  
  
   
  
 </tr>
 </tbody>
</table>
</div>
-->


<!-- Generated by Doxygen 1.8.0 -->
<script type="text/javascript" src="dynsections.js"></script>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">text-buffer.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="text-buffer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* ============================================================================</span>
<a name="l00002"></a>00002 <span class="comment"> * Freetype GL - A C OpenGL Freetype engine</span>
<a name="l00003"></a>00003 <span class="comment"> * Platform:    Any</span>
<a name="l00004"></a>00004 <span class="comment"> * WWW:         http://code.google.com/p/freetype-gl/</span>
<a name="l00005"></a>00005 <span class="comment"> * ----------------------------------------------------------------------------</span>
<a name="l00006"></a>00006 <span class="comment"> * Copyright 2011,2012 Nicolas P. Rougier. All rights reserved.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
<a name="l00009"></a>00009 <span class="comment"> * modification, are permitted provided that the following conditions are met:</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> *  1. Redistributions of source code must retain the above copyright notice,</span>
<a name="l00012"></a>00012 <span class="comment"> *     this list of conditions and the following disclaimer.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> *  2. Redistributions in binary form must reproduce the above copyright</span>
<a name="l00015"></a>00015 <span class="comment"> *     notice, this list of conditions and the following disclaimer in the</span>
<a name="l00016"></a>00016 <span class="comment"> *     documentation and/or other materials provided with the distribution.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY NICOLAS P. ROUGIER &#39;&#39;AS IS&#39;&#39; AND ANY EXPRESS OR</span>
<a name="l00019"></a>00019 <span class="comment"> * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF</span>
<a name="l00020"></a>00020 <span class="comment"> * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO</span>
<a name="l00021"></a>00021 <span class="comment"> * EVENT SHALL NICOLAS P. ROUGIER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,</span>
<a name="l00022"></a>00022 <span class="comment"> * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES</span>
<a name="l00023"></a>00023 <span class="comment"> * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</span>
<a name="l00024"></a>00024 <span class="comment"> * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span>
<a name="l00025"></a>00025 <span class="comment"> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT</span>
<a name="l00026"></a>00026 <span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF</span>
<a name="l00027"></a>00027 <span class="comment"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00028"></a>00028 <span class="comment"> *</span>
<a name="l00029"></a>00029 <span class="comment"> * The views and conclusions contained in the software and documentation are</span>
<a name="l00030"></a>00030 <span class="comment"> * those of the authors and should not be interpreted as representing official</span>
<a name="l00031"></a>00031 <span class="comment"> * policies, either expressed or implied, of Nicolas P. Rougier.</span>
<a name="l00032"></a>00032 <span class="comment"> * ============================================================================</span>
<a name="l00033"></a>00033 <span class="comment"> */</span>
<a name="l00034"></a>00034 <span class="preprocessor">#ifndef __TEXT_BUFFER_H__</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#define __TEXT_BUFFER_H__</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span>
<a name="l00037"></a>00037 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00039"></a>00039 <span class="preprocessor">#endif</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &quot;<a class="code" href="vertex-buffer_8h.html">vertex-buffer.h</a>&quot;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &quot;<a class="code" href="font-manager_8h.html">font-manager.h</a>&quot;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &quot;<a class="code" href="markup_8h.html">markup.h</a>&quot;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#include &quot;<a class="code" href="shader_8h.html">shader.h</a>&quot;</span>
<a name="l00045"></a>00045 
<a name="l00046"></a>00046 
<a name="l00050"></a><a class="code" href="text-buffer_8h.html#aeb06e08fcb145b25caf33204ae04c7b7">00050</a> <span class="preprocessor">#define LCD_FILTERING_ON    3</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span>
<a name="l00055"></a><a class="code" href="text-buffer_8h.html#abd50406866c6d3953be0f0203dc6da6b">00055</a> <span class="preprocessor">#define LCD_FILTERING_OFF 1</span>
<a name="l00056"></a>00056 <span class="preprocessor"></span>
<a name="l00081"></a><a class="code" href="structtext__buffer__t.html">00081</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
<a name="l00085"></a><a class="code" href="structtext__buffer__t.html#a1d13ea520cd74f396f67b3b3ab844c58">00085</a>     <a class="code" href="structvertex__buffer__t.html" title="Generic vertex buffer.">vertex_buffer_t</a> *<a class="code" href="structtext__buffer__t.html#a1d13ea520cd74f396f67b3b3ab844c58" title="Vertex buffer.">buffer</a>;
<a name="l00086"></a>00086 
<a name="l00090"></a><a class="code" href="structtext__buffer__t.html#a7d9ae1107c2046a5a37fa0000c2fa10f">00090</a>     <a class="code" href="structfont__manager__t.html" title="Structure in charge of caching fonts.">font_manager_t</a> *<a class="code" href="structtext__buffer__t.html#a7d9ae1107c2046a5a37fa0000c2fa10f" title="Font manager.">manager</a>;
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 
<a name="l00096"></a><a class="code" href="structtext__buffer__t.html#a325a44fac0204b8715ea8d77c998f8f1">00096</a>     <a class="code" href="unionvec2.html" title="Tuple of 2 floats.">vec2</a> <a class="code" href="structtext__buffer__t.html#a325a44fac0204b8715ea8d77c998f8f1" title="Pen origin.">origin</a>;
<a name="l00097"></a>00097 
<a name="l00098"></a>00098 
<a name="l00102"></a><a class="code" href="structtext__buffer__t.html#aa18977695e0384540858d4f3c9e1834e">00102</a>     <span class="keywordtype">size_t</span> <a class="code" href="structtext__buffer__t.html#aa18977695e0384540858d4f3c9e1834e" title="Index (in the vertex buffer) of the line start.">line_start</a>;
<a name="l00103"></a>00103 
<a name="l00107"></a><a class="code" href="structtext__buffer__t.html#afc9b83943f39668e5de2bd032db50cff">00107</a>     <span class="keywordtype">float</span> <a class="code" href="structtext__buffer__t.html#afc9b83943f39668e5de2bd032db50cff" title="Current line ascender.">line_ascender</a>;
<a name="l00108"></a>00108 
<a name="l00112"></a><a class="code" href="structtext__buffer__t.html#a796e9d16743d243a6ae08cc8ddccd103">00112</a>     <span class="keywordtype">float</span> <a class="code" href="structtext__buffer__t.html#a796e9d16743d243a6ae08cc8ddccd103" title="Current line decender.">line_descender</a>;
<a name="l00113"></a>00113 
<a name="l00117"></a><a class="code" href="structtext__buffer__t.html#a5e12b91a66da41fc23a5675b94086394">00117</a>     GLuint <a class="code" href="structtext__buffer__t.html#a5e12b91a66da41fc23a5675b94086394" title="Shader handler.">shader</a>;
<a name="l00118"></a>00118 
<a name="l00122"></a><a class="code" href="structtext__buffer__t.html#aac3629453a9b7545243d3f3770b6df7e">00122</a>     GLuint <a class="code" href="structtext__buffer__t.html#aac3629453a9b7545243d3f3770b6df7e" title="Shader &quot;texture&quot; location.">shader_texture</a>;
<a name="l00123"></a>00123 
<a name="l00127"></a><a class="code" href="structtext__buffer__t.html#a359ca8eb9a341df2cbdea9b56ebdbfe5">00127</a>     GLuint <a class="code" href="structtext__buffer__t.html#a359ca8eb9a341df2cbdea9b56ebdbfe5" title="Shader &quot;pixel&quot; location.">shader_pixel</a>;
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 } <a class="code" href="structtext__buffer__t.html" title="Text buffer structure.">text_buffer_t</a>;
<a name="l00130"></a>00130 
<a name="l00131"></a>00131 
<a name="l00132"></a>00132 
<a name="l00136"></a><a class="code" href="structglyph__vertex__t.html">00136</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
<a name="l00140"></a><a class="code" href="structglyph__vertex__t.html#a3144c24728ef9455facb38874a59e613">00140</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#a3144c24728ef9455facb38874a59e613" title="Vertex x coordinates.">x</a>;
<a name="l00141"></a>00141 
<a name="l00145"></a><a class="code" href="structglyph__vertex__t.html#af619460c34acc4ef05987e7ab94b0827">00145</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#af619460c34acc4ef05987e7ab94b0827" title="Vertex y coordinates.">y</a>;
<a name="l00146"></a>00146 
<a name="l00150"></a><a class="code" href="structglyph__vertex__t.html#a86fd89cdafb3baefed678f8ffb17a2c1">00150</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#a86fd89cdafb3baefed678f8ffb17a2c1" title="Vertex z coordinates.">z</a>;
<a name="l00151"></a>00151 
<a name="l00155"></a><a class="code" href="structglyph__vertex__t.html#a423bb4678719bad57423f0ec04f231b6">00155</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#a423bb4678719bad57423f0ec04f231b6" title="Texture first coordinate.">u</a>;
<a name="l00156"></a>00156 
<a name="l00160"></a><a class="code" href="structglyph__vertex__t.html#a4c10a56c7e1e274219a6473b31d60a4a">00160</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#a4c10a56c7e1e274219a6473b31d60a4a" title="Texture second coordinate.">v</a>;
<a name="l00161"></a>00161 
<a name="l00165"></a><a class="code" href="structglyph__vertex__t.html#a7da98f58364eb79788d55a02014e403d">00165</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#a7da98f58364eb79788d55a02014e403d" title="Color red component.">r</a>;
<a name="l00166"></a>00166 
<a name="l00170"></a><a class="code" href="structglyph__vertex__t.html#ad3fe8c84894dd9e8a63e491c0aae1312">00170</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#ad3fe8c84894dd9e8a63e491c0aae1312" title="Color green component.">g</a>;
<a name="l00171"></a>00171 
<a name="l00175"></a><a class="code" href="structglyph__vertex__t.html#a2ba72b2a940ec38d94220534d67f8e35">00175</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#a2ba72b2a940ec38d94220534d67f8e35" title="Color blue component.">b</a>;
<a name="l00176"></a>00176 
<a name="l00180"></a><a class="code" href="structglyph__vertex__t.html#aa65d27ef0736c24f6094bf7e051b1059">00180</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#aa65d27ef0736c24f6094bf7e051b1059" title="Color alpha component.">a</a>;
<a name="l00181"></a>00181 
<a name="l00185"></a><a class="code" href="structglyph__vertex__t.html#aadf4dd4b66e92b7cf7d518f55a31475b">00185</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#aadf4dd4b66e92b7cf7d518f55a31475b" title="Shift along x.">shift</a>;
<a name="l00186"></a>00186 
<a name="l00190"></a><a class="code" href="structglyph__vertex__t.html#a0d05d289eb4ac93f4aebe08aef68e275">00190</a>     <span class="keywordtype">float</span> <a class="code" href="structglyph__vertex__t.html#a0d05d289eb4ac93f4aebe08aef68e275" title="Color gamma correction.">gamma</a>;
<a name="l00191"></a>00191 
<a name="l00192"></a>00192 } <a class="code" href="structglyph__vertex__t.html" title="Glyph vertex structure.">glyph_vertex_t</a>;
<a name="l00193"></a>00193 
<a name="l00194"></a>00194 
<a name="l00195"></a>00195 
<a name="l00204"></a>00204   <a class="code" href="structtext__buffer__t.html" title="Text buffer structure.">text_buffer_t</a> *
<a name="l00205"></a>00205   <a class="code" href="group__text-buffer.html#gad40995db39664d6d3f9da68d386a99da" title="Creates a new empty text buffer.">text_buffer_new</a>( <span class="keywordtype">size_t</span> depth );
<a name="l00206"></a>00206 
<a name="l00207"></a>00207 
<a name="l00214"></a>00214   <span class="keywordtype">void</span>
<a name="l00215"></a>00215   <a class="code" href="group__text-buffer.html#gadbcccef4916637e046f5b342f195d635" title="Render a text buffer.">text_buffer_render</a>( <a class="code" href="structtext__buffer__t.html" title="Text buffer structure.">text_buffer_t</a> * <span class="keyword">self</span> );
<a name="l00216"></a>00216 
<a name="l00217"></a>00217 
<a name="l00226"></a>00226   <span class="keywordtype">void</span>
<a name="l00227"></a>00227   <a class="code" href="group__text-buffer.html#gabedbb9b1ad170e17545d2144bca1cca1" title="Print some text to the text buffer.">text_buffer_printf</a>( <a class="code" href="structtext__buffer__t.html" title="Text buffer structure.">text_buffer_t</a> * <span class="keyword">self</span>, <a class="code" href="unionvec2.html" title="Tuple of 2 floats.">vec2</a> * pen, ... );
<a name="l00228"></a>00228 
<a name="l00229"></a>00229 
<a name="l00239"></a>00239   <span class="keywordtype">void</span>
<a name="l00240"></a>00240   <a class="code" href="group__text-buffer.html#ga7d8bb02091e52fb172209510fef2f036" title="Add some text to the text buffer.">text_buffer_add_text</a>( <a class="code" href="structtext__buffer__t.html" title="Text buffer structure.">text_buffer_t</a> * <span class="keyword">self</span>,
<a name="l00241"></a>00241                         <a class="code" href="unionvec2.html" title="Tuple of 2 floats.">vec2</a> * pen, <a class="code" href="structmarkup__t.html" title="Simple structure that describes text properties.">markup_t</a> * markup,
<a name="l00242"></a>00242                         <span class="keywordtype">wchar_t</span> * text, <span class="keywordtype">size_t</span> length );
<a name="l00243"></a>00243 
<a name="l00253"></a>00253   <span class="keywordtype">void</span>
<a name="l00254"></a>00254   <a class="code" href="group__text-buffer.html#ga625e357eb097ca5f1e775b6157ccefea" title="Add a char to the text buffer.">text_buffer_add_wchar</a>( <a class="code" href="structtext__buffer__t.html" title="Text buffer structure.">text_buffer_t</a> * <span class="keyword">self</span>,
<a name="l00255"></a>00255                          <a class="code" href="unionvec2.html" title="Tuple of 2 floats.">vec2</a> * pen, <a class="code" href="structmarkup__t.html" title="Simple structure that describes text properties.">markup_t</a> * markup,
<a name="l00256"></a>00256                          <span class="keywordtype">wchar_t</span> current, <span class="keywordtype">wchar_t</span> previous );
<a name="l00257"></a>00257 
<a name="l00263"></a>00263   <span class="keywordtype">void</span>
<a name="l00264"></a>00264   <a class="code" href="group__text-buffer.html#ga69afa8b4e27b15fe420a529b5a9bec53" title="Clear text buffer.">text_buffer_clear</a>( <a class="code" href="structtext__buffer__t.html" title="Text buffer structure.">text_buffer_t</a> * <span class="keyword">self</span> );
<a name="l00265"></a>00265 
<a name="l00266"></a>00266 
<a name="l00269"></a>00269 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00270"></a>00270 <span class="preprocessor"></span>}
<a name="l00271"></a>00271 <span class="preprocessor">#endif</span>
<a name="l00272"></a>00272 <span class="preprocessor"></span>
<a name="l00273"></a>00273 <span class="preprocessor">#endif </span><span class="comment">/* #define __TEXT_BUFFER_H__ */</span>
</pre></div></div><!-- contents -->
</div>
</body>
</html>
